package lunify;

import java.util.Collection;

/**
 * This is the class that, given a file to read (via FReader), 
 * @author katie
 */
public abstract class LProcessor{
    
    
    private String nickname, title, url;
    public LProcessor(String nickname, String title, String url){
        this.nickname = nickname;
        this.title = title;
        this.url = url;
    }
    
    public Rows process(FReader file){
        Rows t = new Rows();
        while(file.nextLine()!=null){
            t.add(process(file.currentLine()));
        }
        return t;
    }
    
    protected abstract Collection<Row> process(String line);
    
    
    @Override
    public String toString(){
        return nickname+" ("+title+" @ "+url+")";
    }
    
}